package uk.co.bumbumtrain

class Volunteer {

	String name
	static hasMany = [skills:Skill]
    static constraints = {
	    id (visible:false)	
	    skills (nullable:false, blank:false)
    }
	
	public boolean hasSkill(Skill skill){
		List<Skill> skills = skills;
		log.info(id.toString() + skill.toString() + " -> " + skills.toString() + "?");
		boolean foundIt = skills != null && skills.contains(skill);
		log.info("Returning: " + foundIt);
		return foundIt;
	}
	
	public String toString() {
		return "Volunteer[ id: " + id + " | Name: " + name + " | Skills " + skills + "] ";
	}
}

